﻿using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Configuration;
using DropBoxClient.Entities;

namespace DropBoxClient.Tests
{
    [TestClass]
    public class MoveFileTest
    {
        private string accessToken;
        private OAuth2Client client;
        private Meta meta;

        [TestInitialize]
        public void Init()
        {
            accessToken = ConfigurationManager.AppSettings["AccessToken"];
            client = new OAuth2Client(accessToken);
            meta = client.Move(StringConstants.SandboxRoot, "Test/Notes.txt", "Test/Test2/Notes.txt");
        }

        [TestMethod]
        public void MoveFile_ResultIsNotNull()
        {
            Assert.IsNotNull(meta);
        }

        [TestMethod]
        public void MoveFile_PathIsValid()
        {
            Assert.AreEqual("/Test/Test2/Notes.txt", meta.Path);
        }

        [TestCleanup]
        public void Cleanup()
        {
            client.Move(StringConstants.SandboxRoot, "Test/Test2/Notes.txt", "Test/Notes.txt");
        }
    }
}
